package ru.urfc.portal.ui.client.googlets.admin;

import ru.urfc.portal.ui.client.BaseGooglet;
import ru.urfc.portal.ui.client.Style;
import ru.urfc.portal.ui.client.googlets.client.ContragentInfo;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;

public class ClientInfo extends BaseGooglet {

	interface Binder extends UiBinder<Widget, ClientInfo> {}
	private static Binder binder = GWT.create(Binder.class);
	
	@UiField Style style;
	@UiField Element name;
	@UiField Element rfcRegistrationDate;
	@UiField Element postalAddress;
	@UiField Element head;
	@UiField Element phone;
	@UiField Element fax;
	@UiField Element email;

	@UiField Element contracts;
	@UiField Element contractTemplate;
	@UiField Element contract;
	
	@Override
	protected void init() {
		initWidget(binder.createAndBindUi(this));
		
		createController(ContragentInfo.createDescriptor(getItemId(),
				name, rfcRegistrationDate, postalAddress, head, phone, fax, email));
		
		createController(ContragentInfo.createDescriptor(getItemId(), contract),
				contracts, contractTemplate);
	}

}